<template>
  <div>
    <van-nav-bar
      :left-text="leftText"
      left-arrow
      @click-left="goBack"
      style="margin-bottom:1rem"
    />
    <van-field v-model="value" maxlength="15" placeholder="填写患者分组名称" />
    <div class="btn-box">
      <div class="weui-btn weui-btn_primary" :class="value?'':'weui-btn_disabled'" @click="save">保存</div>
    </div>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        value: '',
        leftText: '分组管理'
      }
    },
    methods: {
      save() {
        this.$router.go(-1)
      },
      goBack() {
        this.$router.go(-1)
      }
    },
    created() {
      if(this.$route.query && this.$route.query.fromChat=='') {
        this.leftText = ''
      } 
    }
  }
</script>
<style lang="stylus">
.btn-box
  box-sizing: border-box
  width: 100%
  .weui-btn
    border-radius: 20px
    border: none
    width: 90%
    height: 37px
    text-align: center
    line-height: 37px
    margin: 20px auto 0
    color: #fff
    &.weui-btn_primary
      border: none
      background: #108ee9
    &.weui-btn_disabled
      border: none
      background: #c3e3f9
</style>